﻿using System;
using UnityEngine;

namespace RenderHeads.Media.AVProVideo
{
	// Token: 0x02000042 RID: 66
	public sealed class NullMediaPlayer : BaseMediaPlayer
	{
		// Token: 0x060001D5 RID: 469 RVA: 0x0000B418 File Offset: 0x00009618
		public override string GetVersion()
		{
			return "0.0.0";
		}

		// Token: 0x060001D6 RID: 470 RVA: 0x0000B420 File Offset: 0x00009620
		public override bool OpenVideoFromFile(string path, long offset, string httpHeaderJson)
		{
			this._texture_AVPro = (Texture2D)Resources.Load("AVPro");
			this._texture_AVPro1 = (Texture2D)Resources.Load("AVPro1");
			if (this._texture_AVPro)
			{
				this._Width = this._texture_AVPro.width;
				this._height = this._texture_AVPro.height;
			}
			this._texture = this._texture_AVPro;
			this._fakeFlipTime = 0f;
			this._frameCount = 0;
			return true;
		}

		// Token: 0x060001D7 RID: 471 RVA: 0x0000B4A8 File Offset: 0x000096A8
		public override void CloseVideo()
		{
			this._frameCount = 0;
			Resources.UnloadAsset(this._texture_AVPro);
			Resources.UnloadAsset(this._texture_AVPro1);
		}

		// Token: 0x060001D8 RID: 472 RVA: 0x0000B4C8 File Offset: 0x000096C8
		public override void SetLooping(bool bLooping)
		{
			this._bLoop = bLooping;
		}

		// Token: 0x060001D9 RID: 473 RVA: 0x0000B4D4 File Offset: 0x000096D4
		public override bool IsLooping()
		{
			return this._bLoop;
		}

		// Token: 0x060001DA RID: 474 RVA: 0x0000B4DC File Offset: 0x000096DC
		public override bool HasMetaData()
		{
			return true;
		}

		// Token: 0x060001DB RID: 475 RVA: 0x0000B4E0 File Offset: 0x000096E0
		public override bool CanPlay()
		{
			return true;
		}

		// Token: 0x060001DC RID: 476 RVA: 0x0000B4E4 File Offset: 0x000096E4
		public override bool HasAudio()
		{
			return false;
		}

		// Token: 0x060001DD RID: 477 RVA: 0x0000B4E8 File Offset: 0x000096E8
		public override bool HasVideo()
		{
			return false;
		}

		// Token: 0x060001DE RID: 478 RVA: 0x0000B4EC File Offset: 0x000096EC
		public override void Play()
		{
			this._isPlaying = true;
			this._isPaused = false;
			this._fakeFlipTime = 0f;
		}

		// Token: 0x060001DF RID: 479 RVA: 0x0000B508 File Offset: 0x00009708
		public override void Pause()
		{
			this._isPlaying = false;
			this._isPaused = true;
		}

		// Token: 0x060001E0 RID: 480 RVA: 0x0000B518 File Offset: 0x00009718
		public override void Stop()
		{
			this._isPlaying = false;
			this._isPaused = false;
		}

		// Token: 0x060001E1 RID: 481 RVA: 0x0000B528 File Offset: 0x00009728
		public override bool IsSeeking()
		{
			return false;
		}

		// Token: 0x060001E2 RID: 482 RVA: 0x0000B52C File Offset: 0x0000972C
		public override bool IsPlaying()
		{
			return this._isPlaying;
		}

		// Token: 0x060001E3 RID: 483 RVA: 0x0000B534 File Offset: 0x00009734
		public override bool IsPaused()
		{
			return this._isPaused;
		}

		// Token: 0x060001E4 RID: 484 RVA: 0x0000B53C File Offset: 0x0000973C
		public override bool IsFinished()
		{
			return this._isPlaying && this._currentTime >= this.GetDurationMs();
		}

		// Token: 0x060001E5 RID: 485 RVA: 0x0000B560 File Offset: 0x00009760
		public override bool IsBuffering()
		{
			return false;
		}

		// Token: 0x060001E6 RID: 486 RVA: 0x0000B564 File Offset: 0x00009764
		public override float GetDurationMs()
		{
			return 10000f;
		}

		// Token: 0x060001E7 RID: 487 RVA: 0x0000B56C File Offset: 0x0000976C
		public override int GetVideoWidth()
		{
			return this._Width;
		}

		// Token: 0x060001E8 RID: 488 RVA: 0x0000B574 File Offset: 0x00009774
		public override int GetVideoHeight()
		{
			return this._height;
		}

		// Token: 0x060001E9 RID: 489 RVA: 0x0000B57C File Offset: 0x0000977C
		public override float GetVideoDisplayRate()
		{
			return 10f;
		}

		// Token: 0x060001EA RID: 490 RVA: 0x0000B584 File Offset: 0x00009784
		public override Texture GetTexture(int index)
		{
			return this._texture;
		}

		// Token: 0x060001EB RID: 491 RVA: 0x0000B58C File Offset: 0x0000978C
		public override int GetTextureFrameCount()
		{
			return this._frameCount;
		}

		// Token: 0x060001EC RID: 492 RVA: 0x0000B594 File Offset: 0x00009794
		public override bool RequiresVerticalFlip()
		{
			return false;
		}

		// Token: 0x060001ED RID: 493 RVA: 0x0000B598 File Offset: 0x00009798
		public override void Rewind()
		{
			this.Seek(0f);
		}

		// Token: 0x060001EE RID: 494 RVA: 0x0000B5A8 File Offset: 0x000097A8
		public override void Seek(float timeMs)
		{
			this._currentTime = timeMs;
		}

		// Token: 0x060001EF RID: 495 RVA: 0x0000B5B4 File Offset: 0x000097B4
		public override void SeekFast(float timeMs)
		{
			this._currentTime = timeMs;
		}

		// Token: 0x060001F0 RID: 496 RVA: 0x0000B5C0 File Offset: 0x000097C0
		public override float GetCurrentTimeMs()
		{
			return this._currentTime;
		}

		// Token: 0x060001F1 RID: 497 RVA: 0x0000B5C8 File Offset: 0x000097C8
		public override void SetPlaybackRate(float rate)
		{
			this._playbackRate = rate;
		}

		// Token: 0x060001F2 RID: 498 RVA: 0x0000B5D4 File Offset: 0x000097D4
		public override float GetPlaybackRate()
		{
			return this._playbackRate;
		}

		// Token: 0x060001F3 RID: 499 RVA: 0x0000B5DC File Offset: 0x000097DC
		public override float GetBufferingProgress()
		{
			return 0f;
		}

		// Token: 0x060001F4 RID: 500 RVA: 0x0000B5E4 File Offset: 0x000097E4
		public override void MuteAudio(bool bMuted)
		{
		}

		// Token: 0x060001F5 RID: 501 RVA: 0x0000B5E8 File Offset: 0x000097E8
		public override bool IsMuted()
		{
			return true;
		}

		// Token: 0x060001F6 RID: 502 RVA: 0x0000B5EC File Offset: 0x000097EC
		public override void SetVolume(float volume)
		{
			this._volume = volume;
		}

		// Token: 0x060001F7 RID: 503 RVA: 0x0000B5F8 File Offset: 0x000097F8
		public override float GetVolume()
		{
			return this._volume;
		}

		// Token: 0x060001F8 RID: 504 RVA: 0x0000B600 File Offset: 0x00009800
		public override int GetAudioTrackCount()
		{
			return 0;
		}

		// Token: 0x060001F9 RID: 505 RVA: 0x0000B604 File Offset: 0x00009804
		public override int GetCurrentAudioTrack()
		{
			return 0;
		}

		// Token: 0x060001FA RID: 506 RVA: 0x0000B608 File Offset: 0x00009808
		public override void SetAudioTrack(int index)
		{
		}

		// Token: 0x060001FB RID: 507 RVA: 0x0000B60C File Offset: 0x0000980C
		public override int GetVideoTrackCount()
		{
			return 0;
		}

		// Token: 0x060001FC RID: 508 RVA: 0x0000B610 File Offset: 0x00009810
		public override int GetCurrentVideoTrack()
		{
			return 0;
		}

		// Token: 0x060001FD RID: 509 RVA: 0x0000B614 File Offset: 0x00009814
		public override string GetCurrentAudioTrackId()
		{
			return string.Empty;
		}

		// Token: 0x060001FE RID: 510 RVA: 0x0000B61C File Offset: 0x0000981C
		public override int GetCurrentAudioTrackBitrate()
		{
			return 0;
		}

		// Token: 0x060001FF RID: 511 RVA: 0x0000B620 File Offset: 0x00009820
		public override void SetVideoTrack(int index)
		{
		}

		// Token: 0x06000200 RID: 512 RVA: 0x0000B624 File Offset: 0x00009824
		public override string GetCurrentVideoTrackId()
		{
			return string.Empty;
		}

		// Token: 0x06000201 RID: 513 RVA: 0x0000B62C File Offset: 0x0000982C
		public override int GetCurrentVideoTrackBitrate()
		{
			return 0;
		}

		// Token: 0x06000202 RID: 514 RVA: 0x0000B630 File Offset: 0x00009830
		public override float GetVideoFrameRate()
		{
			return 0f;
		}

		// Token: 0x06000203 RID: 515 RVA: 0x0000B638 File Offset: 0x00009838
		public override void Update()
		{
			this.UpdateSubtitles();
			if (this._isPlaying)
			{
				this._currentTime += Time.deltaTime * 1000f;
				if (this._currentTime >= this.GetDurationMs())
				{
					this._currentTime = this.GetDurationMs();
					if (this._bLoop)
					{
						this.Rewind();
					}
				}
				this._fakeFlipTime += Time.deltaTime;
				if ((double)this._fakeFlipTime >= 0.1)
				{
					this._fakeFlipTime = 0f;
					this._texture = ((!(this._texture == this._texture_AVPro)) ? this._texture_AVPro : this._texture_AVPro1);
					this._frameCount++;
				}
			}
		}

		// Token: 0x06000204 RID: 516 RVA: 0x0000B70C File Offset: 0x0000990C
		public override void Render()
		{
		}

		// Token: 0x06000205 RID: 517 RVA: 0x0000B710 File Offset: 0x00009910
		public override void Dispose()
		{
		}

		// Token: 0x0400017B RID: 379
		private bool _isPlaying;

		// Token: 0x0400017C RID: 380
		private bool _isPaused;

		// Token: 0x0400017D RID: 381
		private float _currentTime;

		// Token: 0x0400017E RID: 382
		private float _volume;

		// Token: 0x0400017F RID: 383
		private float _playbackRate = 1f;

		// Token: 0x04000180 RID: 384
		private bool _bLoop;

		// Token: 0x04000181 RID: 385
		private int _Width = 256;

		// Token: 0x04000182 RID: 386
		private int _height = 256;

		// Token: 0x04000183 RID: 387
		private Texture2D _texture;

		// Token: 0x04000184 RID: 388
		private Texture2D _texture_AVPro;

		// Token: 0x04000185 RID: 389
		private Texture2D _texture_AVPro1;

		// Token: 0x04000186 RID: 390
		private float _fakeFlipTime;

		// Token: 0x04000187 RID: 391
		private int _frameCount;

		// Token: 0x04000188 RID: 392
		private const float FrameRate = 10f;
	}
}
